﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ST.Application.RoleServices.Dtos;
using ST.Domain;

namespace ST.Application.RoleServices
{
    public interface IRoleService
    {
        /// <summary>
        ///     获取列表
        /// </summary>
        /// <returns></returns>
        Task<List<RoleDto>> GetAllList();

        /// <summary>
        ///     获取分页列表
        /// </summary>
        /// <param name="startPage">起始页</param>
        /// <param name="pageSize">页面大小</param>
        /// <returns></returns>
        Task<PagedList<RoleDto>> GetAllPageListAsync(int startPage, int pageSize);

        Task<bool> InsertAsync(RoleDto dto);
        Task<bool> UpdateAsync(RoleDto dto);
        Task DeleteBatchAsync(List<Guid> ids);
        Task DeleteAsync(Guid id);
        Task<RoleDto> GetAsync(Guid id);

        /// <summary>
        ///     根据角色获取权限
        /// </summary>
        /// <returns></returns>
        List<Guid> GetAllMenuListByRole(Guid roleId);

        /// <summary>
        ///     更新角色权限关联关系
        /// </summary>
        /// <param name="roleId">角色id</param>
        /// <param name="roleMenus">角色权限集合</param>
        /// <returns></returns>
        bool UpdateRoleMenu(Guid roleId, List<RoleMenuDto> roleMenus);
    }
}